package org.example.completed.controller;

import org.example.completed.domain.Active;
import org.example.completed.service.ActiveService;
import org.example.completed.utils.ApiResponse;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
public class ActivityController {
    private ActiveService activeService;

    @Autowired
    public ActivityController(ActiveService activeService){
        this.activeService = activeService;
    }

    // 获取所有的热门活动
    @GetMapping("/getAllActives")
    public ApiResponse<List<Active>> getAllActives() {
        return ApiResponse.success(activeService.getAllActive(),"获取成功");
    }
}